package com.forekonw.demo5;

import java.util.Scanner;

/**
 * 方法的参数和返回值类型也可以是自定义类型
 * 1.如果方法的返回值类型为类类型，那么return后面一定是一个对象(new  创建的才是对象)
 *  在实际应用中如果从数据库中查询到一条数据就可以用对象来保存数据
 */
public class Manager {
    public Student get(){
        Student aa = new Student();
        aa.name = "asds";
        aa.sid = "1100";
        return aa;
    }

    /**
     * 添加学生信息
     */
    public void a (Student student) {
        System.out.println(student.sid+student.name);
    }

    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入学生编号：");
        String sid = input.next();
        System.out.println("请输入学生姓名：");
        String name = input.next();

        Manager manager = new Manager();
        Student student = new Student();
        student.sid = sid;
        student.name = name;
        manager.a(student);









    }

}
